package com.itheima.threadDemo.Demo10;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread{
    private ArrayBlockingQueue<String> ab;
    public Foodie(ArrayBlockingQueue<String> ab) {
        this.ab = ab;
    }

    @Override
    public void run() {
        while(true){
            try {
                String take = ab.take();
                System.out.println("吃货将" + take + "拿出来吃了");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
